local iputils = require("resty.iputils")
local redis = require("resty.redis")

blocked_ips = {}
local red = redis:new()
red:set_timeout(2000) -- 2s

local ok ,err = red:connect("127.0.0.1",6379)
if not ok then
	return
end

local res, err = red:auth("qD-tq4xEx")
if not res then
	--ngx.say("failed to authenticate: ", err)
	return
end

res , err = red:SMEMBERS("block_ips")
if not res then
	return
end

for i, v in ipairs(res) do  
	table.insert(blocked_ips,v)
end  

local ok, err = red:set_keepalive(10000, 100)
if not ok then
	--ngx.say("failed to set keepalive: ", err)
	return
end

for i, ip in ipairs(res) do
        ngx.say(ip)
end


